home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / MISC / HCAL-27 / TRUNORTH.BAS (.txt) < prev    next >
Encoding:
GW-BASIC  |  1997-01-29  |  4.4 KB  |  152 lines

  1. 10  'TRUNORTH - True North Finder - 24 FEB 96 rev. 28 SEP 96
  2. 20  'Ref. ARRL ANTENNA BOOK, 14th Edition, page 16-2
  3. 30  IF EX$=""THEN EX$="EXIT"
  4. 40  PROG$="trunorth"
  5. 50  COMMON EX$,PROG$
  6. 60  CLS:KEY OFF
  7. 70  COLOR 7,0,1
  8. 80  DIM M$(12)     'month names
  9. 90  DIM C(36,3)    'wobble factors
  10. 100  U$="#####"
  11. 110  UL$=STRING$(80,205)
  12. 120  '
  13. 130  DATA Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec
  14. 140  FOR Z=1 TO 12:READ M$(Z):NEXT Z
  15. 150  '
  16. 160  '.....wobble correction factors
  17. 170  DATA  4,8,11,  13,14,14,  13,10,8,  4,1,-1,       -3,-4,-4,     -3,-1,1
  18. 180  DATA  4,5,6,   6,5,3,     1,-3,-7,  -10,-13,-15,  -16,-16,-14,  -11,-7,-2
  19. 190  Y=-9
  20. 200  FOR Z=1 TO 36
  21. 210     M=Z/3:IF M=INT(M) THEN C(Z,1)=M ELSE C(Z,1)=INT(M)+1
  22. 220     Y=Y+10:C(Z,2)=Y
  23. 230     IF Y=21 THEN Y=-9
  24. 240   READ C(Z,3)
  25. 250  NEXT Z
  26. 260  '
  27. 270  '.....start
  28. 280  CLS
  29. 290  COLOR 15,2
  30. 300  PRINT " TRUE NORTH via the Sun";TAB(57)"by George Murphy VE3ERP ";
  31. 310  COLOR 1,0:PRINT STRING$(80,223);
  32. 320  COLOR 7,0
  33. 330  GOSUB 930   'preface
  34. 340  PRINT
  35. 350  COLOR 0,7
  36. 360  LOCATE ,22:PRINT " Press 1 to continue or 0 to quit...."
  37. 370  COLOR 7,0
  38. 380  Z$=INKEY$:IF Z$=""THEN 380
  39. 390  IF Z$="0"THEN CLS:RUN EX$
  40. 400  IF Z$="1"THEN 430
  41. 410  GOTO 380
  42. 420  '
  43. 430  COLOR 0,7:LOCATE CSRLIN-1,2
  44. 440  PRINT " Do you want to convert degree/minute/second values to decimal ";
  45. 450  PRINT "degrees? (y/n) ";
  46. 460  COLOR 7,0
  47. 470  Z$=INKEY$:IF Z$=""THEN 470
  48. 480  IF Z$="y"THEN CLS:CHAIN "equiv"
  49. 490  IF Z$="n"THEN 520
  50. 500  GOTO 470
  51. 510  '
  52. 520  '.....inputs
  53. 530  VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
  54. 540  PRINT " ENTER: Your longitude in decimal degrees:"
  55. 550  PRINT "        (MINUS value if West, PLUS value if East)....";:INPUT DEG
  56. 560  DEG=-DEG
  57. 570  LN=CSRLIN-2:VIEW PRINT LN TO 24:CLS:VIEW PRINT:LOCATE 3
  58. 580  IF SGN(DEG)=1 THEN L$="W"ELSE L$="E"
  59. 590  TIM=(-DEG-7.5)/15
  60. 600  IF TIM=INT(TIM)THEN UTC=TIM ELSE UTC=INT(TIM+1)     'UTC differential
  61. 610  TIM=DEG/15          'time in hours to centre of time zone
  62. 620  SN=TIM+12
  63. 630  T=INT(SN)*100+(SN-INT(SN))*60
  64. 640  T=INT(T+0.5):T$=RIGHT$(STR$(T),LEN(STR$(T))-1)
  65. 650  IF LEN (T$)<4 THEN T$="0"+T$:GOTO 650
  66. 660  PRINT TAB(9)"At longitude";USING "####.#";ABS(DEG);:PRINT "<UNK! {00F8}>";L$;
  67. 670  PRINT " SOLAR NOON times throughout the year are:"
  68. 680  PRINT TAB(9)"(UTC = Universal Co-ordinated Time)   (LST = Local SOLAR Time)"
  69. 690  PRINT UL$;
  70. 700  '
  71. 710  '.....display
  72. 720     FOR Z=1 TO 18
  73. 730  N=SN+C(Z,3)/60:IF N>=1160 THEN N=N+40
  74. 740  IF N<0 THEN N=N+24
  75. 750  T=INT(N)*100+(N-INT(N))*60
  76. 760  T=INT(T+0.5):T$=RIGHT$(STR$(T),LEN(STR$(T))-1)
  77. 770  IF LEN (T$)<4 THEN T$="0"+T$:GOTO 770
  78. 780  LST=T+UTC*100:IF LST>=2400 THEN LST=T-1200
  79. 790  PRINT TAB(6)M$(C(Z,1));USING "###";C(Z,2);
  80. 800  PRINT " @ ";T$;" UTC (";LST;"LST )";
  81. 810  '
  82. 820  N=SN+C(Z+18,3)/60:IF N>=1160 THEN N=N+40
  83. 830  IF N<0 THEN N=N+24
  84. 840  T=INT(N)*100+(N-INT(N))*60
  85. 850  T=INT(T+0.5):T$=RIGHT$(STR$(T),LEN(STR$(T))-1)
  86. 860  IF LEN (T$)<4 THEN T$="0"+T$:GOTO 860
  87. 870  LST=T+UTC*100:IF LST>=2400 THEN LST=T-1200
  88. 880  PRINT TAB(47)M$(C(Z+18,1));USING "###";C(Z+18,2);
  89. 890  PRINT " @ ";T$;" UTC (";LST;"LST )"
  90. 900     NEXT Z
  91. 910  GOTO 1340
  92. 920  '
  93. 930  '.....preface
  94. 940  M=7
  95. 950  PRINT TAB(M);
  96. 960  PRINT "  The shadow of a vertically plumb stake cast by the sun at High"
  97. 970  PRINT TAB(M);
  98. 980  PRINT "Noon runs exactly north and south. This ancient axiom can be used to"
  99. 990  PRINT TAB(M);
  100. 1000  PRINT "aim your antenna, orient a sundial, or calibrate your car compass."
  101. 1010  PRINT TAB(M);
  102. 1020  PRINT "  If the stake is north of lat. 23.5<UNK! {00F8}>N the shadow points north, if"
  103. 1030  PRINT TAB(M);
  104. 1040  PRINT "south of lat. 23.5<UNK! {00F8}>S, it points south. If the stake is between"
  105. 1050  PRINT TAB(M);
  106. 1060  PRINT "these latitudes and above the Equator the shadow points north in"
  107. 1070  PRINT TAB(M);
  108. 1080  PRINT "the winter and south in the summer. If south of the Equator it"
  109. 1090  PRINT TAB(M);
  110. 1100  PRINT "points north in the summer and south in the winter."
  111. 1110  PRINT TAB(M);
  112. 1120  PRINT "  To determine just when High Noon is, you must know your longitude."
  113. 1130  PRINT TAB(M);
  114. 1140  PRINT "This will tell you when High Noon is SUPPOSED to occur but doesn't,"
  115. 1150  PRINT TAB(M);
  116. 1160  PRINT "due to the somewhat erratic wobbling of the earth about its axis as"
  117. 1170  PRINT TAB(M);
  118. 1180  PRINT "it circles the sun. Ancient mathematicians didn't know much about"
  119. 1190  PRINT TAB(M);
  120. 1200  PRINT "the wobble but we do, so we have to take it into account, which the"
  121. 1210  PRINT TAB(M);
  122. 1220  PRINT "program does."
  123. 1230  PRINT TAB(M);
  124. 1240  PRINT "  The program refers to High Noon as SOLAR NOON (it sounds more"
  125. 1250  PRINT TAB(M);
  126. 1260  PRINT "High Tech). Local SOLAR (geophysical) TIMES shown may not be the"
  127. 1270  PRINT TAB(M);
  128. 1280  PRINT "same as STANDARD (political) TIMES in some political jurisdictions."
  129. 1290  PRINT
  130. 1300  PRINT TAB(M);
  131. 1310  PRINT "  Your longitude must be entered in decimal degrees."
  132. 1320  RETURN
  133. 1330  '
  134. 1340  '.....end
  135. 1350  GOSUB 1390
  136. 1360  GOTO 270
  137. 1370  END
  138. 1380  '
  139. 1390  'HARDCOPY
  140. 1400  GOSUB 1510:LOCATE 25,2:COLOR 14,6
  141. 1410  PRINT " Press 1 to print screen, 2 to print screen & ";
  142. 1420  PRINT "advance paper, or 3 to continue.";:COLOR 7,0
  143. 1430  Z$=INKEY$:IF Z$="3"THEN GOSUB 1510:RETURN
  144. 1440  IF Z$="1"OR Z$="2"THEN GOSUB 1510:GOTO 1460
  145. 1450  GOTO 1430
  146. 1460  FOR QX=1 TO 24:FOR QY=1 TO 80
  147. 1470  LPRINT CHR$(SCREEN(QX,QY));
  148. 1480  NEXT QY:NEXT QX
  149. 1490  IF Z$="2"THEN LPRINT CHR$(12)
  150. 1500  GOTO 1400
  151. 1510  LOCATE 25,1:PRINT STRING$(80,32);:RETURN
  152.